<?php 
session_start();
session_unset() ;
session_destroy();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link type="text/css" href="css/template.css" rel="stylesheet" />
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery.validate.js"></script>
<script type="text/javascript" src="js/jquery.form.js"></script>
<script type="text/javascript" language="javascript">
	$(document).ready(function() {
	$().ajaxStart(function() {
			$("#error-login").html("<div id='loading'><img src='img/7hwy7at6.gif' height='11' width='16' /></div>");
			//$("#formulario").hide();
		}).ajaxStop(function() {
			//$("#loading").hide();
			//$("#formulario").fadeIn('fast');
		}).ajaxError(function(a, b, e) {
			throw e;
		});
		
		var v = jQuery("#myform").validate({
			
			submitHandler: function(form) {
				jQuery(form).ajaxSubmit({
					target: "#error-login",
					success: function(data) {
						data = data.replace(/[\r\n]/,"").replace(/[\n]/,"");
						if(data.length == 0) window.location.href="panel.php";
					}
				});
				
				//window.location.href="http://www.pronet21.com";
				
			}
		});
	});
</script>
<title>UEMPPAT-TRUJILLO</title>
</head>

<body>
<?php include_once("encabezado.html") ?>
<div>
	<div style="border:1px solid #999; width:500px; margin:0 auto; min-height:200px; padding:5px;">
    <form id="myform" class="login" method="post"  action="login.php" enctype="application/x-www-form-urlencoded">
    <div class="info"><h2>Ingrese su nombre de usuario y contraseña:</h2></div>
    <ul>
    	<li><label class="desc">Nombre Usuario:</label></li>
        <li><input type="text" name="usuario" class="required" /></li>
        <li><label class="desc">Password:</label></li>
        <li><input type="password" name="password" class="required" /></li>
        <li class="buttons"><input type="submit" value="Entrar" /></li>
        <li id="error-login"></li>
    </ul>
    </form>
    </div>
</div>
<?php include("pie-de-pagina.php"); ?>
</body>
</html>